package com.nanyang.tms.manager.forecast.handler.weight;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import javax.annotation.PostConstruct;

import com.nanyang.common.core.flow.context.TransHandlerContext;
import com.nanyang.common.core.flow.handler.AbstractTransHandler;

public abstract class AbstractCalculateWeight   implements ICalculateWeight{
	public static Map<String, AbstractCalculateWeight> calculateWeightMap = new ConcurrentHashMap<String, AbstractCalculateWeight>();
	
	@PostConstruct
	public void init() {
		calculateWeightMap.put(getCalculateType(), this);
	}
	
	@Override
	public boolean process(TransHandlerContext context) {
		return generalProcess(context);
	}
	
	public abstract String getCalculateType();
	
	public abstract boolean generalProcess(TransHandlerContext context);

}
